package com.dingding.service.core.common.dao.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.dingding.common.core.base.daox.IBaseDaoX;
import com.dingding.common.core.base.daox.ICriteriaBaseDao;
import com.dingding.common.core.base.daox.ISQLBaseDao;
import com.dingding.common.core.beans.RegisterChannel;
import com.dingding.service.core.common.dao.IRegisterChannelDao;
import com.dingding.service.core.common.sql.ChannelSQL;

/**
 * 
 * @ClassName: DriverChannelDaoImpl 
 * @Description: 司机渠道来源相关的dao接口实现
 * @author hufan
 * @date 2016年12月21日 下午2:36:43 
 *
 */
@Component("registerChannelDao")
public class RegisterChannelDaoImpl implements IRegisterChannelDao{

	@Resource(name = "SQLBaseDao")
	private ISQLBaseDao sqlBaseDao;

	@Resource(name = "criteriaBaseDao")
	private ICriteriaBaseDao criteriaBaseDao;

	@Resource(name = "baseDaoX")
	private IBaseDaoX baseDaoX;
	
	/**
	 * 
	 * @Title: queryDriverChannelByChannelId 
	 * @Description: 根据channelId查询有效
	 * @param  参数说明 
	 * @author hufan
	 * @return 返回类型 
	 * @throws
	 */
	@Override
	@Transactional(readOnly = true)
	public RegisterChannel queryRegisterChannelByChannelId(Integer channelId) {
		
		if(channelId == null) {
			return null;
		}
		return sqlBaseDao.sqlToCustomBeanUnique(RegisterChannel.class, ChannelSQL.QUERY_REGISTER_CHANNEL_BY_CHANNELID, channelId);
	}

}
